﻿using Coldairarrow.Entity.Base_Company;
using Coldairarrow.Util;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.Business.Base_Company
{
    public interface IBTB_Company_VisitLogBusiness
    {
        Task<PageResult<BTB_Company_VisitLog>> GetDataListAsync(PageInput<ConditionDTO> input);
        Task<BTB_Company_VisitLog> GetTheDataAsync(string id);
        Task AddDataAsync(BTB_Company_VisitLog data);
        Task UpdateDataAsync(BTB_Company_VisitLog data);
        Task DeleteDataAsync(List<string> ids);
        int GetPVCount();
        int GetUVCount();
        int GetIPCount();

        #region//用户统计数据
        Task<object> GetPointLog(PageInput<SearchDTO> input);

        PointLogDTO GetUThePointData(IdInputDTO input);

        Task<object> GetTicketLog(PageInput<TKTSearchDTO> input);

        UserTicketLogDTO GetTheTicketLogData(IdInputDTO input);

        Task<object> GetUserRebateLogs(PageInput<RBTSearcDTO> input);

        UserRebateLogDTO GetTheUserRebateLogData(IdInputDTO input);

        Task<object> GetUserRebateDataAsnyc(PageInput<SearchDTO> input);

        UserProfitDTO GetTheUserRebateData(IdInputDTO input);
        #endregion
    }

    public class SearchDTO
    { 
        public string KeyWord { set; get; }
        
        public DateTime? StartTime { set; get; }

        public DateTime? EndTime { set; get; }
    }

    public class TKTSearchDTO
    {
        public string KeyWord { set; get; }

        public int? State { set; get; }

        public DateTime? StartTime { set; get; }

        public DateTime? EndTime { set; get; }
    }

    public class RBTSearcDTO {
        public string XKeyWord { set; get; }

        public string FKeyWord { set; get; }

        public int? RType { set; get; }

        public DateTime? StartTime { set; get; }

        public DateTime? EndTime { set; get; }
    }

    public class PointLogDTO
    {
        public string Id { set; get; }

        public string NickName { set; get; }

        public string RealName { set; get; }

        public int? Sex { set; get; }

        public string Phone { set; get; }

        public int? HeadType { set; get; }
        public string HeadUrl { set; get; }

        public string Sorce { set; get; }

        public int? PType { set; get; }

        public int? Point { set; get; }

        public DateTime CreateTime { set; get; }

    }

    public class UserTicketLogDTO
    {
        public string Id { set; get; }

        public string NickName { set; get; }

        public string RealName { set; get; }

        public int? Sex { set; get; }

        public string Phone { set; get; }

        public string HeadUrl { set; get; }

        public int? HeadType { set; get; }

        public string Sorce { set; get; }

        public string TicketName { set; get; }

        public decimal TicketAmont { set; get; }

        public decimal? TicketUseMoney { set; get; }

        public DateTime TicketStartTime { set; get; }

        public DateTime TicketEndTime { set; get; }

        public int? TicketState { set; get; }

        public DateTime CreateTime { set; get; }

    }

    public class UserRebateLogDTO
    {
        public string Id { set; get; }

        public string FUserName { set; get; }

        public string FRealName { set; get; }

        public int? FSex { set; get; }

        public string FPhone { set; get; }

        public string FHeadUrl { set; get; }

        public int? FHeadType { set; get; }

        public string XUserName { set; get; }

        public string XRealName { set; get; }

        public int? XSex { set; get; }

        public string XPhone { set; get; }

        public string XHeadUrl { set; get; }

        public int? XHeadType { set; get; }
        public string Note { set; get; }

        public int RType { set; get; }

        public string OrderId { set; get; }

        public string GoodsName { set; get; }

        public string GoodsItemName { set; get; }

        public decimal GoodsPrice { get; set; }

        public int? GoodsNum { get; set; }

        public decimal GoodsAmont { set; get; }

        public decimal ReturnDiscount { set; get; }

        public decimal ReturnMoney { set; get; }

        public DateTime CreateTime { get; set; }
    }

    public class UserProfitDTO {
        public string Id { set; get; }

        public string NickName { set; get; }

        public string RealName { set; get; }

        public int? Sex { set; get; }

        public string Phone { set; get; }

        public int? HeadType { set; get; }

        public string HeadUrl { set; get; }

        /// <summary>
        /// 总收益
        /// </summary>
        public decimal SumProfit { set; get; }

        /// <summary>
        /// 已退回收益
        /// </summary>
        public decimal ReturnProfit { set; get; }

        /// <summary>
        /// 可提现收益
        /// </summary>
        public decimal CashProfit { set; get; }

        /// <summary>
        /// 已提现收益
        /// </summary>
        public decimal CashedProfit { set; get; }

        /// <summary>
        /// 可提现收益中未提现收益
        /// </summary>
        public decimal NotCashProfit { set; get; }

        /// <summary>
        /// 未到期收益
        /// </summary>
        public decimal NotDueCashProfit { set; get; }

        /// <summary>
        /// 今日可提现收益
        /// </summary>
        public decimal TodayCashProfit { set; get; }

        /// <summary>
        /// 今日已提现收益
        /// </summary>
        public decimal TodayCashedProfit { set; get; }

        /// <summary>
        /// 今日未提现收益
        /// </summary>
        public decimal TodayNotCashProfit { set; get; }

        /// <summary>
        /// 注册时间
        /// </summary>
        public DateTime JoinTime { set; get; }
    } 

}